Skip to content

seg rm-state: delete .tmp files from snapshot directories#19549

Merged
AskAlexSharov merged 1 commit intomainfrom
bridge/erigon-18789-datadir-rm-state
Mar 2, 2026
Merged

seg rm-state: delete .tmp files from snapshot directories#19549
AskAlexSharov merged 1 commit intomainfrom
bridge/erigon-18789-datadir-rm-state

Conversation

@sudeepdino008
Copy link
Member

@sudeepdino008 sudeepdino008 commented Mar 1, 2026

Summary

  • DeleteStateSnapshots now unconditionally removes .tmp files from all 7 snapshot directories: Snap, SnapIdx, SnapHistory, SnapDomain, SnapAccessors, SnapCaplin, SnapForkable
  • .tmp files are artifacts from incomplete/cancelled operations and were previously skipped because ParseFileName() cannot parse them
  • Cleanup respects --dry-run mode and is not subject to --step, --latest, or --domain filters

Test plan

  • Test_DeleteStateSnaps_RemovesTmpFiles: verifies .tmp files across all 7 directories are cleaned up
  • Test_DeleteStateSnaps_DryRunKeepsTmpFiles: verifies dry-run mode preserves .tmp files

Closes #18789

DeleteStateSnapshots now unconditionally removes .tmp files from all 7
snapshot directories (Snap, SnapIdx, SnapHistory, SnapDomain,
SnapAccessors, SnapCaplin, SnapForkable). These are artifacts from
incomplete or cancelled operations and should always be cleaned up.

The cleanup respects --dry-run mode and is not subject to --step,
--latest, or --domain filters.

Closes #18789
@sudeepdino008 sudeepdino008 force-pushed the bridge/erigon-18789-datadir-rm-state branch from c276621 to 2965899 Compare March 1, 2026 17:48
@AskAlexSharov AskAlexSharov merged commit 94d8e90 into main Mar 2, 2026
25 checks passed
@AskAlexSharov AskAlexSharov deleted the bridge/erigon-18789-datadir-rm-state branch March 2, 2026 04:48
sudeepdino008 added a commit that referenced this pull request Mar 4, 2026
## Summary
- `DeleteStateSnapshots` now unconditionally removes `.tmp` files from
all 7 snapshot directories: `Snap`, `SnapIdx`, `SnapHistory`,
`SnapDomain`, `SnapAccessors`, `SnapCaplin`, `SnapForkable`
- `.tmp` files are artifacts from incomplete/cancelled operations and
were previously skipped because `ParseFileName()` cannot parse them
- Cleanup respects `--dry-run` mode and is not subject to `--step`,
`--latest`, or `--domain` filters

## Test plan
- [x] `Test_DeleteStateSnaps_RemovesTmpFiles`: verifies `.tmp` files
across all 7 directories are cleaned up
- [x] `Test_DeleteStateSnaps_DryRunKeepsTmpFiles`: verifies dry-run mode
preserves `.tmp` files

Closes #18789
sudeepdino008 added a commit that referenced this pull request Mar 4, 2026
## Summary
- `DeleteStateSnapshots` now unconditionally removes `.tmp` files from
all 7 snapshot directories: `Snap`, `SnapIdx`, `SnapHistory`,
`SnapDomain`, `SnapAccessors`, `SnapCaplin`, `SnapForkable`
- `.tmp` files are artifacts from incomplete/cancelled operations and
were previously skipped because `ParseFileName()` cannot parse them
- Cleanup respects `--dry-run` mode and is not subject to `--step`,
`--latest`, or `--domain` filters

## Test plan
- [x] `Test_DeleteStateSnaps_RemovesTmpFiles`: verifies `.tmp` files
across all 7 directories are cleaned up
- [x] `Test_DeleteStateSnaps_DryRunKeepsTmpFiles`: verifies dry-run mode
preserves `.tmp` files

Closes #18789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

seg rm-state: to filter-out .tmp files

2 participants